//
//  binfile1.h
//  MIPS Dissambler
//
//  Created by Daniel Diaz on 1/30/12.
//  Copyright 2012 UCI. All rights reserved.
//

#ifndef MIPS_Dissambler_binfile1_h
#define MIPS_Dissambler_binfile1_h

/**ReadBinFile (char * fname);*/

typedef struct InstructionEntry IENTRY;
typedef struct InstructionList ILIST;

typedef struct {
    ILIST * InstructionList;
	unsigned int ActualInstruction;		/* Instruction */
}INSTRUCTION;

struct Instructionlist
{
    unsigned int  Length; /* Length of the list*/
    /*unsigned int NumberInstructions:*/
    IENTRY *First; /* pointer to the first entry, or NULL */
    IENTRY *Last; /* pointer to the last entry, or NULL  */
};

struct InstructionEntry
{
    ILIST  *List;   /* pointer to the list which this entry belongs to */
    IENTRY *Next;   /* pointer to the next entry, or NULL */
    IENTRY *Prev;   /* pointer to the previous entry, or NULL */
    int instruction;  /* Instruction */
    DECODED *DeInstruction; 
};


void DeleteInstruction(INSTRUCTION *Instruction);

/* allocate a new instruction list */
ILIST *NewInstructionList(void);

/* delete a instruction list (and all entries) */
void DeleteInstructionList(ILIST *l);

/* insert an instruction into a list */
void AppendInstruction(ILIST *l, int z);




#endif
